﻿var MCP = MCP || {};

MCP.Helper = MCP.Helper || (function () {

	var clone = function (obj) {
		// (c) OWL JavaScript Utilities
		// Oran Looney, April 2008

		if (typeof obj !== 'object') {
			return obj;
		} else {
			var value = obj.valueOf();
			if (obj != value) {
				return new obj.constructor(value);
			} else {
				if (obj instanceof obj.constructor && obj.constructor !== Object) {
					var c = clone(obj.constructor.prototype);

					for (var property in obj) {
						if (obj.hasOwnProperty(property)) {
							c[property] = obj[property];
						}
					}
				} else {
					var c = {};
					for (var property in obj) c[property] = obj[property];
				}

				return c;
			}
		}
	};
	

	
	var parseFloatValue = function (selectorID) {
		return parseFloat($(selectorID).val().replace(',', '.'));
	};

	return {
		Copy: clone,
		ParseFloatValue: parseFloatValue
	};
})()